import time

import requests


def send_message(message):
    url = "https://open.feishu.cn/open-apis/bot/v2/hook/355717d7-2330-40f6-a284-923d7e3975ca"
    current_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
    method = 'post'
    headers = {
        'Content-Type': 'application/json'
    }
    json = {
        "msg_type": "text",
        "content": {
            "msg": "错误信息告警",
            "text": f"项目：云设计UI自动化测试 \n"
                    f"错误信息：\n"
                    f"{message} \n"
                    f"时间：{current_time}",
            "tag": "lark_md"
        }}
    rep = requests.request(method=method, url=url, headers=headers, json=json)

